<?php


namespace app\admin\controller;


use app\common\bean\ConfigBean;
use app\common\bean\ListMap;
use app\common\controller\AdminController;
use app\common\manage\ConfigManage;
use app\common\utils\ExitJsonUtil;

class Config extends AdminController
{
    /** 配置修改
     * @return mixed
     * @throws \Exception
     */
    public function editConfig(){
        if(request()->isPost()){
            $listMap = new ListMap();
            $listMap->setData($this->postParams);
            ConfigManage::getInstance()->editConfig($listMap);
            redirect("");
        }
        $configList = ConfigManage::getInstance()->getConfig([ConfigBean::$storeId => 0]);
        $this->assign('configList',$configList);
        return $this->fetch();
    }
}